Date.prototype.pattern = function (fmt) {
    var o = {
        "M+": this.getMonth() + 1, //月份  
        "d+": this.getDate(), //日  
        "h+": this.getHours() % 12 == 0 ? 12 : this.getHours() % 12, //小时  
        "H+": this.getHours(), //小时  
        "m+": this.getMinutes(), //分  
        "s+": this.getSeconds(), //秒  
        "q+": Math.floor((this.getMonth() + 3) / 3), //季度  
        "S": this.getMilliseconds() //毫秒  
    };
    var week = {
        "0": "/u65e5",
        "1": "/u4e00",
        "2": "/u4e8c",
        "3": "/u4e09",
        "4": "/u56db",
        "5": "/u4e94",
        "6": "/u516d"
    };
    if (/(y+)/.test(fmt)) {
        fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
    }
    if (/(E+)/.test(fmt)) {
        fmt = fmt.replace(RegExp.$1, ((RegExp.$1.length > 1) ? (RegExp.$1.length > 2 ? "/u661f/u671f" : "/u5468") : "") + week[this.getDay() + ""]);
    }
    for (var k in o) {
        if (new RegExp("(" + k + ")").test(fmt)) {
            fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
        }
    }
    return fmt;
}
var devid = "";
var detailObj = {
    deviceArr: [],
    page: 1,
    tppage: 1,
    totalPages: 0,
    loginId:'',
    sessionData:'',
    index: -1,//工地地址
    dataArr: [],
    dwData1: [],
    dwData: [],
    plateColor: 0,
    GCMC: "",
    GCDZ: "",
    TFZL: "",
    ZYCBD: "",
    YSCD: "",
    TFXNC: "",
    SFXN: "",
    SFAZS: "",
    SFSZC: "",
    fanwei: "",
    fanwei: 0,
    num: "",
    point: "",
    zyz: "0",
    bool:0,
    ztcdevid:"",
    gdid:"",
    devid:[],
    functions: {
        init: function () {
            detailObj.functions.getztcdata();
            detailObj.functions.dwDatainof();
            detailObj.functions.deviceAttend();
            detailObj.functions.initCondition();
            var begintime = detailObj.functions.getDateStr(-10) + " 00:00:00";
            var endtime = detailObj.functions.getCurrentDay();
            detailObj.GCMC = detailObj.functions.getUrlParam("GCMC");
            detailObj.GCDZ = detailObj.functions.getUrlParam("GCDZ");
            detailObj.TFZL = detailObj.functions.getUrlParam("GCXZ");
            if(detailObj.functions.getUrlParam("FANWEI")){
                detailObj.fanwei = parseInt(detailObj.functions.getUrlParam("FANWEI"));
            }else if(detailObj.functions.getUrlParam("fanwei")){
                detailObj.fanwei = parseInt(detailObj.functions.getUrlParam("fanwei")); 
            }
            
            detailObj.ZYCBD = detailObj.functions.getUrlParam("JSDW");
            detailObj.YSCD = detailObj.functions.getUrlParam("SGDW");
            detailObj.TFXNC = detailObj.functions.getUrlParam("JLDW");
            detailObj.SFXN = detailObj.functions.getUrlParam("SFXN");
            detailObj.SFAZS = detailObj.functions.getUrlParam("SFAZS");
            detailObj.SFSZC = detailObj.functions.getUrlParam("SFSZC");
            detailObj.gdid=detailObj.functions.getUrlParam("gdid");
            detailObj.num = detailObj.functions.getUrlParam("num");
            detailObj.point = detailObj.functions.getUrlParam("point");
            if (detailObj.GCMC != "undefined") {
                $("#GCMC").text(detailObj.GCMC);
            }
            if (detailObj.TFZL != "undefined") {
                $("#GCXZ").text(detailObj.TFZL);
            }
            if(detailObj.YSCD!="undefined"){
                $("#SGDW").text(detailObj.YSCD);
            }
            
            if (detailObj.GCDZ != "undefined") {
                $("#GCDZ").text(detailObj.GCDZ);
                $("#GCDZ1").text(detailObj.GCDZ);
            }
            if (detailObj.ZYCBD != "undefined") {
                $("#JSDW").text(detailObj.ZYCBD);
            }
            if (detailObj.TFXNC != "undefined") {
                $("#JLDW").text(detailObj.TFXNC);
            }
            if (detailObj.SFXN != "undefined") {
                $("#SFXN").text(detailObj.SFXN);
            }
            if (detailObj.SFAZS != "undefined") {
                $("#SFAZS").text(detailObj.SFAZS);
            }
            if (detailObj.SFSZC != "undefined") {
                $("#SFSZC").text(detailObj.SFSZC);
            }

            if (detailObj.num == "5") {
                $("#img").css("display", "none");
                $("#myVideo").css("display", "block");
                $("#myVideo").attr("src", "video/gongdi.mp4");
            }
            if (detailObj.num == "4") {
                $("#img").css("display", "none");
                $("#myVideo").css("display", "block");
                $("#myVideo").attr("src", "video/gongdi1.mp4");
                detailObj.fanwei = 9;
                devid = "11010806001320006606";
            }
            if (detailObj.num == "8") {

                devid = "11010806001320006606";
            }
            if (detailObj.num == "61") {
                devid = "11010805001320005183";
            }
            if (detailObj.num == "46") {
                devid = "11010808001320008501";
            }
            if(detailObj.GCMC=="北体育馆"){
                detailObj.fanwei=7;
                detailObj.num="54";
            }
            if(detailObj.GCMC=="清华大学综合实验楼"){
                detailObj.fanwei=6;
                detailObj.num="53";
            }
            if (detailObj.fanwei >0) {
                var html_ = "";
                if (detailObj.num != "4") {
                    for (var i = 1; i <= detailObj.fanwei; i++) {
                        html_ += `<div class="gdxx_left_item">
                        <img src="gdtp/${detailObj.num}/fanwei/${detailObj.num}_0${i}.jpg" class="gdxx_left_img">
                        <p>${detailObj.GCDZ}</p>
                    </div>`;
                    }

                    $("#img").html(html_);
                }
            }
            if(detailObj.GCDZ=="海淀区颐和园路海淀体育中心内,海淀区体育局东北120米"){
                var html_ = "";
                html_ += `<div class="gdxx_left_item">
                        <img src="images/22222.png" class="gdxx_left_img">
                        <p>${detailObj.GCDZ}</p>
                    </div>`;
                    $("#img").html(html_);
            }
            $("#siteAddress").text(detailObj.GCDZ);
            $("#GCMC").attr("title", detailObj.GCMC);
            $("#GCDZ").attr("title", detailObj.GCDZ);
            $("#TFZL").attr("title", detailObj.TFZL);
            $("#ZYCBD").attr("title", detailObj.ZYCBD);
            $("#YSCD").attr("title", detailObj.YSCD);
            $("#TFXNC").attr("title", detailObj.TFXNC);
            $("#SFXN").attr("title", detailObj.SFXN);
            $("#SFAZS").attr("title", detailObj.SFAZS);
            $("#SFSZC").attr("title", detailObj.SFSZC);
            
        
            
            
        },
        prevDetail: function () { },
        nextDetail: function () { },
        pagesLeft: function () {
            if (detailObj.page > 1) {
                detailObj.page -= 1;
                detailObj.functions.getztcdata();
            }

        },
        pagesRight: function () {
            if (detailObj.page <= detailObj.totalPages) {
                detailObj.page += 1;
                detailObj.functions.getztcdata();
            }

        },
        initCondition: function () {
            $("#report").off("click").on("click", function () {
                layui.use('layer', function () {
                    var layer = layui.layer;
                    layer.open({
                        type: 2,
                        fixed: true,
                        title: ['重点车辆研判报告列表', 'font-size: 22px;color: rgb(49, 70, 89);'],
                        closeBtn: 1,
                        scrollbar: false,
                        maxmin: false,
                        content: '/vias_app/views/vias/urbanManagementLawEnforcement/chgzhf/reportOnlinePreview.html',
                        area: ['1000px', '800px'],
                        end: function () {
                        }
                    });
                });
            })
            //显示无牌车添加事件获取点击的值
            layui.use(['layer', 'form'], function () {
                var layer = layui.layer,
                    $ = layui.jquery,
                    form = layui.form;//必须先声明 
            });
        },
        tzztc:function(){
            window.open("http://11.16.127.79/vias_app/views/vias/snapshot/ztc/ztc.html?token=undefined&subMenu=ztcwf&user=undefined&screeType=undefined&devid="+ detailObj.functions.getUrlParam("deviceId")+"&beginTime="+detailObj.functions.getDateStr(-1) + " 09:00:00"+"&endTime="+ detailObj.functions.getDateStr(0)+" 09:00:00"+"&cardval=true");
        },
        zyz: function (z) {
            var begintime = detailObj.functions.getDateStr(-1) + " 09:00:00";
            var endtime = detailObj.functions.getDateStr(0) + " 09:00:00";
            detailObj.zyz = z;
            detailObj.page = 1;
            $.ajax({
                type: 'get',
                dataType: "json",
                data: {
                    page: detailObj.page,
                    rows: 9,
                    plateNo: "",
                    vehicleBrand: "",
                    beginTime: begintime,
                    endTime: endtime,
                    vehicleColor: "",
                    plateColor: "",
                    showNoPlate: false,
                    sourceID: "",
                    deviceId: detailObj.functions.getUrlParam("deviceId"),
                    labelTypes: "",
                    userName: "jgp",
                    isZYZ: detailObj.zyz,
                    defaultAlgorithm: false,
                    baiDuAlgorithm: false,
                    yiSaAlgorithm: false,
                    allAlgorithm: true,
                },
                 url: 'http://11.16.127.79:8013/VIAS/web/ztc/findZtcData',
          //     url: 'http://10.111.183.63:8013/VIAS/web/ztc/findZtcData',
                success: function (data) {
                    if (data.rows.length > 0) {
                        detailObj.dataArr = data.rows;
                        detailObj.totalPages = data.totalPages;
                        var rightHTML = [];
                        len = data.rows.length;
                        for (var i = 0; i < len; i++) {
                            var html_ = `<div class="gdxx_btm_item" onclick="detailObj.functions.showmotor('${data.rows[i].SS_ID}','${data.rows[i].PASS_TIME}','${data.rows[i].DEVICE_ID}','${begintime}',this,'${data.rows[i].PLATE_NO}','${data.rows[i].PLATE_COLOR}')">
                            <p class="cph">${data.rows[i].PASS_TIME}</p>
                            <img src="${data.rows[i].STORAGE_URL3}">
                            <p>${data.rows[i].SS_APE_NAME}</p>
                        </div>`
                            rightHTML.push(html_);
                        }
                        $("#record").empty().html(rightHTML.join(''));
                    } else {
                        var noResult = '<div class="list_res_empty" style="height:2.9rem;position:relative;clear:both;">' +
                            ' <div style="width:1.42rem;height:1.75rem;position:absolute;top: 3.8rem;left: 4.8rem;margin:-0.87rem -0.71rem;background:url(images/list_res_empty.png) center center no-repeat;background-size:contain;"></div>' +
                            ' </div>';
                        $("#record").empty();
                        $("#record").append(noResult);
                    }
                }
            });
        },
        prevDetail: function () {
            if (detailObj.fanwei != 0) {
                if (detailObj.tppage > 1) {
                    detailObj.tppage -= 1;
                    $("#myVideo").css("display", "none");
                    $("#img").css("display", "block");
                    $("#img").attr('src', 'gdtp/' + detailObj.num + '/fanwei/' + detailObj.num + '_0' + detailObj.tppage + '.jpg');
                } else if (detailObj.tppage == 1 && detailObj.num == "4") {
                    $("#img").css("display", "none");
                    $("#myVideo").css("display", "block");
                    $("#myVideo").attr("src", "video/gongdi1.mp4");
                } else {
                    $("#img").attr('src', 'gdtp/' + detailObj.num + '/fanwei/' + detailObj.num + '_0' + detailObj.tppage + '.jpg');

                }
            }

        },
        bayonet: function (event) {
            var parma = "";
            var videoid="";
            if (event.geometry != null) {
                parma = '?deviceId=' + event.geometry.devid;
                videoid= event.geometry.devid;
            } else {
                parma = '?deviceId=' + event.getAttribute("devid");
                videoid= event.getAttribute("devid");
            }

            layui.use('layer', function () {
                var layer = layui.layer;
                layer.open({
                    type: 2,
                    fixed: true,
                    title: ['卡口详情：<span style="font-size:15px">' + event.getAttribute("devname") + '</span>', 'font-size: 22px;color: rgb(49, 70, 89);'],
                    closeBtn: 1,
                    scrollbar: false,
                    maxmin: false,
                    content: 'jiaotong/shishiSP1.html' + parma,
                    area: ['50%', '75%'],
                    cancel: function (index, layero) {
                        videoDisplayFucStop(videoid);
                    }

                });
            });
        }

        ,
        bayonetwkk: function (event) {
            var parma = "";
            var videoid="";
            if (event.geometry != null) {
                parma = '?deviceId=' + event.geometry.devid;
                videoid= event.geometry.devid;
            } else {
                parma = '?deviceId=' + event.getAttribute("devid");
                videoid= event.getAttribute("devid");
            }

            layui.use('layer', function () {
                var layer = layui.layer;
                layer.open({
                    type: 2,
                    fixed: true,
                    title: ['卡口详情 <span style="font-size:15px">' + event.getAttribute("devname") + '</span>', 'font-size: 22px;color: rgb(49, 70, 89);'],
                    closeBtn: 1,
                    scrollbar: false,
                    maxmin: false,
                    content: 'jiaotong/shishiSP.html' + parma,
                    area: ['100%', '100%'],
                    cancel: function (index, layero) {
                        videoDisplayFucStop(videoid);
                    }
                });
            });
        },spkinof:function(){
            $.getJSON("json/gdzbdw.json", function (data) {
                $.each(data,function(i,row){
                    if(detailObj.gdid==row.gcid){
                        detailObj.devid.push(row.devid);
                    }
                })
                detailObj.functions.spkin();
            })
        },
        deviceAttend: function () {
            $.getJSON("json/gdzbdw.json", function (data) {
                var j = 0;
                $.each(data, function (i, row) {
                    if (detailObj.gdid == row.gcid) {
                        detailObj.deviceArr[j] = row.devid;
                        j = j + 1;
                        console.log(j);
                    }
                })
                $(function () {
                    console.log(detailObj.deviceArr[0])
                    ssspObj.functions.init();
                });
                detailObj.functions.getztcdata();
            })
        },
        spkin: function(){
        

            var strs= new Array(); //定义一数组
            var deviceArrId= detailObj.functions.getUrlParam("deviceId");
              strs=deviceArrId.split(",");
                    var _html="";
                        $("#total").text(strs.length-1);
                        $.each(detailObj.dwData,function(j,row){
                        $.each(strs, function (i, rows) {
                      
                          if(row.devid==rows){
                            if (row.bayonet == 0 ) {
                                _html += `<div class="spl_res_item"  onclick="detailObj.functions.bayonet(this);" devname="${row.devname}"  devid="${row.devid}"  style="cursor:pointer;border: 1px solid;"  ><div class="spl_res_icon"><img src="images/qji2.png"><img src="images/sp_licon3.png"></div><div class="spl_res_txt"><h4  title="${row.devname}">${row.devname}</h4><p>非微卡口</p><p>${row.streetname}</p></div></div>`;
                            } else if (row.bayonet == 1 ) {
                                _html += `<div class="spl_res_item"  onclick="detailObj.functions.bayonetwkk(this);" devname="${row.devname}" devid="${row.devid}"  style="cursor:pointer;border: 1px solid;"  ><div class="spl_res_icon" ><img src="images/wkk4.png"><img src="images/sp_licon3.png"></div><div class="spl_res_txt"><h4  title="${row.devname}">${row.devname}</h4><p>微卡口</p><p>${row.streetname}</p></div></div>`;
                            }
                            detailObj.ztcdevid+=row.devid+",";
                        
                          }
                      })
                   
             })
                    $("#sql_con").empty();
                    $("#spl_con").html(_html);
                    detailObj.ztcdevid=detailObj.ztcdevid.slice(0,detailObj.ztcdevid.length-1);
                    
             
        }
        ,
        spk: function () {
            var devid = "";
            if(detailObj.bool==0){
               
                    $(".gdxx_btn").css("right","4rem");
                    $(".spl_res").css("right","0rem");
                    detailObj.bool=1;
            }else{
                $(".gdxx_btn").css("right","0rem");
                $(".spl_res").css("right","-4.5rem"); 
                detailObj.bool=0;
            }
            
            // layui.use('layer', function () {
            //     var layer = layui.layer;
            //     layer.open({
            //         type: 2,
            //         fixed: true,
            //         title: ['卡口详情：<span style="font-size:15px"></span>', 'font-size: 22px;color: rgb(49, 70, 89);'],
            //         closeBtn: 1,
            //         scrollbar: false,
            //         maxmin: false,
            //         content: 'jiaotong/shishiSP1.html?deviceId=' + devid,
            //         area: ['50%', '65%'],
            //         cancel: function (index, layero) {
            //             detailObj.functions.stopflv();
            //         }

            //     });
            // });
        }
        ,
        nextDetail: function () {
            if (detailObj.fanwei != 0) {
                if (detailObj.tppage < detailObj.fanwei) {
                    detailObj.tppage += 1;
                    $("#myVideo").css("display", "none");
                    $("#img").css("display", "block");
                    $("#img").attr('src', 'gdtp/' + detailObj.num + '/fanwei/' + detailObj.num + '_0' + detailObj.tppage + '.jpg');
                } else {
                    $("#img").attr('src', 'gdtp/' + detailObj.num + '/fanwei/' + detailObj.num + '_0' + detailObj.tppage + '.jpg');

                }
            }
        }

        ,
        stopflvDe: function () {

            //   var loginid = window.sessionStorage.getItem("id");
            //   var session = window.sessionStorage.getItem("session");
            var loginid = loginId;
            var session = sessionId;
            console.log("loginid:" + loginid + ",session:" + session)
            $.ajax({
                type: 'POST',
                dataType: "JSON",
                async: false,
                contentType: "application/json",
                data: JSON.stringify({ "LoginID": loginid, "Session": session }),
                //url: "http://11.16.127.79:8013/Video/stopreal",
                url: ssspObj.videoStopUrl,
                success: function (data) {
                    console.log(data)
                }
            });

        },
        logoutDe: function () {
            var loginid = loginId;
            console.log(loginid);
            $.ajax({
                //      url: 'http://11.16.127.79:8013/Video/logout',
                url: ssspObj.videoLogoutUrl,
                type: 'post',
                async: false,
                contentType: "application/json", //必须有
                dataType: "json", //表示返回值类型，不必须
                data: JSON.stringify({ "LoginID": loginid }),
                success: function (data) {
                    console.log(data);
                }
            });
        },
        stopflv: function () {

            var loginid = window.sessionStorage.getItem("id");
            var session = window.sessionStorage.getItem("session");
            $.ajax({
                type: 'POST',
                dataType: "JSON",
                contentType: "application/json",
                
                data: JSON.stringify({ "LoginID": loginid, "Session": session }),
                url: "http://11.16.127.79:8013/Video/stopreal",
                success: function (data) {
                    console.log(data)
                    detailObj.functions.logout(loginid);
                }
            });
           
        },
        logout: function (loginid) {
            $.ajax({
                url: 'http://11.16.127.79:8013/Video/logout',
                type: 'post',
                contentType: "application/json", //必须有
                dataType: "json", //表示返回值类型，不必须
                data: JSON.stringify({ "LoginID": loginid }),
                success: function (data) {
                    console.log(data);
                }
            });
        },
        stopflvwkk: function () {

            var loginid = window.sessionStorage.getItem("id");
            var session = window.sessionStorage.getItem("session");
            $.ajax({
                type: 'POST',
                dataType: "JSON",
                contentType: "application/json",
                data: JSON.stringify({ "LoginID": loginid, "Session": session }),
                url: "http://11.16.127.79:8013/Video/stoprealwkk",
                success: function (data) {
                    console.log(data)
                    detailObj.functions.logoutwkk(loginid);
                }
            });
            
        },
        logoutwkk: function (loginid) {
            $.ajax({
                url: 'http://11.16.127.79:8013/Video/logoutwkk',
                type: 'post',
                contentType: "application/json", //必须有
                dataType: "json", //表示返回值类型，不必须
                data: JSON.stringify({ "LoginID": loginid }),
                success: function (data) {
                    console.log(data);
                }
            });
        },
        showmotor: function (ssid, time, device_id, beginTime, obj, plateNo, plateColor) {
            var parma = '?ssid=' + encodeURIComponent(ssid)
                + '&time=' + encodeURIComponent(time)
                + '&deviceId=' + encodeURIComponent(device_id)
                + '&beginTime=' + encodeURIComponent(beginTime)
                + '&plateNo=' + encodeURIComponent(plateNo)
                + '&plateColor=' + encodeURIComponent(plateColor)
                +'&parentObj=detailObj';
            detailObj.index = $(obj).index();
            detailObj.plateColor = plateColor;
            layui.use('layer', function () {
                var layer = layui.layer;
                layer.open({
                    type: 2,
                    fixed: true,
                    title: ['一车一档详情', 'font-size: 22px;color: rgb(49, 70, 89);'],
                    closeBtn: 1,
                    scrollbar: false,
                    maxmin: false,
                    content: '/vias_app/views/vias/snapshot/ztc/oneCarToInfo.html' + parma,
                    area: ['100%', '100%'],
                    end: function () {
                        // 暂时不用
                    }
                });
            });
        },
        getzyzAction: function () {
            var obj = document.getElementsByName("zyzCheck");
            var check_val = [];
            if (obj.length > 0) {
                for (k in obj) {
                    if (obj[k].checked)
                        check_val.push(Number(k) + 1);
                }
                return check_val.join(',');
            } else {
                return "";
            }


        },
        dwDatainof: function () {

            $.ajax({
                type: 'get',
                dataType: "json",
                data: {
                    httpurl: "/cloudSearch/search/basic?table=awkk1&page_size=10000&data_type=2"
                },
                url: "http://11.16.127.79:5013/VIAS/web/snapshot/baidu/BayonetMarking",
                success: function (data) {
                    detailObj.dwData1 = data.data.list;
                    var dwData = data.data.list;
                    $.each(dwData, function (i, row) {
                        if (row.bayonet == 1) {
                            detailObj.dwData.push({

                                type: 'Point',
                                coordinates: row.shape.coordinates,
                                devname: row.devName,
                                devid: row.devId,
                                streetname: row.streetname,
                                bayonet: row.bayonet

                            })
                        } else {
                            detailObj.dwData.push({

                                type: 'Point',
                                coordinates: row.shape.coordinates,
                                devname: row.devName,
                                devid: row.devId,
                                streetname: row.streetname,
                                bayonet: row.bayonet

                            })
                        }

                    })
                    detailObj.functions.spkinof();
                }
            });
        },

        //获取url后的参数值
        getUrlParam: function (key, url) {
            var href = url || window.location.href;
            var url = href.split("?");
            if (url.length <= 1) {
                return "";
            }
            var params = url[1].split("&");

            for (var i = 0; i < params.length; i++) {
                var param = params[i].split("=");
                if (key == param[0]) {
                    if (url[2] != undefined) {
                        return decodeURIComponent(param[1] + '?' + url[2]);
                    }
                    return decodeURIComponent(param[1]);
                }
            }
        },
        //获取前后的时间  返回的时间格式为'2018-04-28 00:00:00'  n为正数 往后n天  n为负数 往前n天
        getCurrentDay: function (n) {
            var today = new Date(),
                date;
            return n ? (new Date(today.getTime() + n * 1000 * 60 * 60 * 24)).pattern("yyyy-MM-dd HH:mm:ss") : new Date().pattern("yyyy-MM-dd HH:mm:ss")
        },
        wkkid: function (id) {
            var devid = "";
            $.each(detailObj.dwData1, function (i, row) {
                var bool = detailObj.functions.confirmEnding(row.devId, id);
                if (bool) {
                    devid = row.devId;

                }
            })
            return devid;
        },
        confirmEnding: function (str, target) {
            // 请把你的代码写在这里
            var start = str.length - target.length;
            var arr = str.substr(start, target.length);
            if (arr == target) {
                return true;
            }
            return false;
        },
        getDateStr: function (AddDayCount) {
            var dd = new Date();
            dd.setDate(dd.getDate() + AddDayCount);//获取AddDayCount天后的日期
            var y = dd.getFullYear();
            var m = (dd.getMonth() + 1) < 10 ? "0" + (dd.getMonth() + 1) : (dd.getMonth() + 1);//获取当前月份的日期，不足10补0
            var d = dd.getDate() < 10 ? "0" + dd.getDate() : dd.getDate();//获取当前几号，不足10补0
            return y + "-" + m + "-" + d;
        }
        ,
        getztcdata: function () {

       var begintime = detailObj.functions.getDateStr(-1) + " 09:00:00";
       var endtime = detailObj.functions.getDateStr(0) + " 09:00:00";
            $.ajax({
                type: 'get',
                dataType: "json",
                data: {
                    page: detailObj.page,
                    rows: 6,
                    plateNo: "",
                    vehicleBrand: "",
                    beginTime: begintime,
                    endTime: endtime,
                    vehicleColor: "",
                    plateColor: "",
                    showNoPlate: true,
                    sourceID: "",
                    deviceId: detailObj.functions.getUrlParam("deviceId"),
                    labelTypes: "",
                    userName: "jgp",
                    isZYZ: "",
                    defaultAlgorithm: false,
                    baiDuAlgorithm: false,
                    yiSaAlgorithm: false,
                    allAlgorithm: true,
                },
                 url: 'http://11.16.127.79:8013/VIAS/web/ztc/findZtcData',
            //   url: 'http://10.111.183.63:8013/VIAS/web/ztc/findZtcData',
                success: function (data) {
                    if (data.rows.length > 0) {
                        detailObj.dataArr = data.rows;
                        detailObj.totalPages = data.totalPages;
                        var rightHTML = [];
                        len = data.rows.length;
                        for (var i = 0; i < len; i++) {
                            var html_ = `<div class="gdxx_btm_item" onclick="detailObj.functions.showmotor('${data.rows[i].SS_ID}','${data.rows[i].PASS_TIME}','${data.rows[i].DEVICE_ID}','${begintime}',this,'${data.rows[i].PLATE_NO}','${data.rows[i].PLATE_COLOR}')">
                            <p class="cph">${data.rows[i].PASS_TIME}</p>
                            <img src="${data.rows[i].STORAGE_URL3}">
                            <p>${data.rows[i].SS_APE_NAME}</p>
                        </div>`
                            rightHTML.push(html_);
                        }
                        $("#record").empty().html(rightHTML.join(''));
                    } else {
                        var noResult = '<div class="list_res_empty" style="height:2.9rem;position:relative;clear:both;">' +
                            ' <div style="width:1.42rem;height:1.75rem;position:absolute;top: 3.8rem;left: 4.8rem;margin:-0.87rem -0.71rem;background:url(images/list_res_empty.png) center center no-repeat;background-size:contain;"></div>' +
                            ' </div>';
                        $("#record").empty();
                        $("#record").append(noResult);
                    }
                }
            });
        }
    }
}